&lt;!--
@author     Yi Bo &lt;etng2004@gmail.com&gt;
@version    $Id: list.php 39 2007-09-02 12:49:05Z etng2004 $
@copyrithg  2006-2007 ETE.CN
@license    PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
--&gt;
&lt;?php
$this-&gt;declareVars();
echo $this-&gt;render('header.php');
require_once(dirname(__FILE__) . '/_meta_<?php echo $this->controller_name;?>.php');
/*$this-&gt;dump($this-&gt;<?php echo $this->single_object; ?>);*/
$<?php echo $this->plural_object ; ?> = $this-&gt;<?php echo $this->plural_object; ?>;

/**
 * 列表相应参数
 */
$checkbox_group = '<?php echo $this->class_object; ?>';
?&gt;
<script type="text/javascript">
<!--
function validateBatchOperateForm(checkboxGroup)
{
	var errors=[];
	if(!checkboxGroup.selected.length)errors.push('请选择至少一个对象！');

	//	var f_status = document.getElementById('field_status');
	//	var v_status = f_status.options[f_status.selectedIndex].value;
	//	if(v_status=="")errors.push('请选择至少一种批量操作！');

	if(errors.length)
	{
		alert("请纠正以下错误后再继续操作：\n\n"+errors.join("\n"));
		return false;
	}
	return true;
}
//-->
</script>

<table cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><!--表头区域，可以用来做搜索等信息的展示-->
    </td>
  </tr>
  <tr>
    <td align="center" valign="top" width="100%">
    <form method="post" action="&lt;?php echo $this->base_url; ?&gt;/batchOperate/" id="frmBatchOperate" name="frmBatchOperate" onsubmit="return validateBatchOperateForm(&lt;?php echo $checkbox_group;?&gt;ChkGroup);">
    <table cellspacing="0" cellpadding="0" id="&lt;?php echo strtolower($checkbox_group);?&gt;_list" class="tblborder" width="100%">
        <tr class="tblhead">
          <td> - </td>
          <?php
foreach ($this->meta['cols'] as $field):
?>
          <td> &lt;?php echo $meta['<?php echo $this->single_object ?>']['fields']['<?php echo $field; ?>'];?&gt; </td>
        <?php
          endforeach;
          ?>
          <td> 操作 </td>
        </tr>
        &lt;?php
        if(!$<?php echo $this->plural_object ; ?>):
	?&gt;
        <tr class="tblbody">
          <td colspan="20"> 无记录 </td>
        </tr>
        &lt;?php
        else:
        foreach ($<?php echo $this->plural_object ; ?> as $<?php echo $this->single_object ; ?>):
	?&gt;
        <tr class="tblbody">
          <td><input type="checkbox" name="fields[&lt;?php echo strtolower($checkbox_group);?&gt;_id][]" id="fields_&lt;?php echo strtolower($checkbox_group);?&gt;_&lt;?php echo $<?php echo $this->single_object ; ?>['id']; ?&gt;" value="&lt;?php echo $<?php echo $this->single_object ; ?>['id']; ?&gt;"/>
          </td>
                <?php
foreach ($this->meta['cols'] as $field):
?>
          <td>&lt;?php echo $<?php echo $this->single_object ; ?>['<?php echo $field; ?>']; ?&gt;</td>
        <?php
          endforeach;
          ?>
          <td>
          <a href=" &lt;?php echo $this->base_url;?&gt;/view/id/&lt;?php echo $<?php echo $this->single_object ; ?>['id'] ?&gt;">查看</a>
          <a href=" &lt;?php echo $this->base_url;?&gt;/edit/id/&lt;?php echo $<?php echo $this->single_object ; ?>['id'] ?&gt;">编辑</a>
          <a href=" &lt;?php echo $this->base_url;?&gt;/remove/id/&lt;?php echo $<?php echo $this->single_object ; ?>['id'] ?&gt;">删除</a>
            </td>
        </tr>
        &lt;?php
        endforeach;
	?&gt;
        <tr class="tblfoot">
          <td colspan="20">
		<a href="javascript:void(0);" onclick="&lt;?php echo $checkbox_group;?&gt;ChkGroup.all();">全选</a>
		<a href="javascript:void(0);" onclick="&lt;?php echo $checkbox_group;?&gt;ChkGroup.inverse();">反选</a>
		<a href="javascript:void(0);" onclick="&lt;?php echo $checkbox_group;?&gt;ChkGroup.clear();">不选</a>
		对选中的对象：
  <select name="operate[status]" id="field_status">
  <option value="">===审核===</option>
&lt;?php
$lang_status_op = array();
foreach ($lang_status_op as $status => $text) {
	if($this->status==$status)continue;
	echo "<option value=\"{$status}\">{$text}</option>\n";
}
  ?&gt;
  </select><input type="submit" value="设置"  />
          </td>
        </tr>
        <tr class="tblfoot">
          <td colspan="20" align="right">&lt;?php
          echo $this->pagination($this->pager['total'], $this->pager['curpage'], $this->pager['perpage'], $this->pager['url'] );
?&gt;
          </td>
        </tr>
        &lt;?php
        endif;
	?&gt;
      </table>
      </form>
      <script type="text/javascript">
      <!--
      var &lt;?php echo $checkbox_group;?&gt;ChkGroup = new EtCheckboxes('&lt;?php echo strtolower($checkbox_group);?&gt;_list','fields_&lt;?php echo strtolower($checkbox_group);?&gt;_',[]);
      //-->
</script>
      </td>
  </tr>
  <tr>
    <td>others</td>
  </tr>
</table>
&lt;?php
echo $this-&gt;render('footer.php');
?&gt;